package com.jrzh.mvc.search.sys;

import org.apache.commons.lang.StringUtils;
import com.jrzh.framework.searchutils.Criteria;
import com.jrzh.framework.searchutils.Restrictions;
import com.jrzh.framework.base.search.BaseSearch;

public class TableNameSearch extends BaseSearch{
	private static final long serialVersionUID = 1L;
	
    /**
     * Equal 表格名称
     */
    private String equalTableName;
    
    /**
     * Like 表格名称
     */
    private String likeTableName;
    
     /**
     * In 表格名称 英文逗号分隔
     */
    private String inTableNames;
    
    /**
     * Equal 是否显示
     */
    private String equalIsShow;
    
    /**
     * Like 是否显示
     */
    private String likeIsShow;
    
     /**
     * In 是否显示 英文逗号分隔
     */
    private String inIsShows;
    
    /**
     * Equal 是否包含树形字段
     */
    private String equalIsTree;
    
    /**
     * Like 是否包含树形字段
     */
    private String likeIsTree;
    
     /**
     * In 是否包含树形字段 英文逗号分隔
     */
    private String inIsTrees;
    
    /**
     * Equal 是否工作流
     */
    private String equalIsWf;
    
    /**
     * Like 是否工作流
     */
    private String likeIsWf;
    
     /**
     * In 是否工作流 英文逗号分隔
     */
    private String inIsWfs;
    
    /**
     * Equal 注释
     */
    private String equalComment;
    
    /**
     * Like 注释
     */
    private String likeComment;
    
     /**
     * In 注释 英文逗号分隔
     */
    private String inComments;
    

    public void setEqualTableName(String equalTableName) {
        this.equalTableName = equalTableName;
    }
    
    public String getEqualTableName() {
        return this.equalTableName;
    }
    
    public void setLikeTableName(String likeTableName) {
        this.likeTableName = likeTableName;
    }
    
    public String getLikeTableName() {
        return this.likeTableName;
    }
    
    public void setInTableNames(String inTableNames) {
        this.inTableNames = inTableNames;
    }
    
    public String getInTableNames() {
        return this.inTableNames;
    }
    public void setEqualIsShow(String equalIsShow) {
        this.equalIsShow = equalIsShow;
    }
    
    public String getEqualIsShow() {
        return this.equalIsShow;
    }
    
    public void setLikeIsShow(String likeIsShow) {
        this.likeIsShow = likeIsShow;
    }
    
    public String getLikeIsShow() {
        return this.likeIsShow;
    }
    
    public void setInIsShows(String inIsShows) {
        this.inIsShows = inIsShows;
    }
    
    public String getInIsShows() {
        return this.inIsShows;
    }
    public void setEqualIsTree(String equalIsTree) {
        this.equalIsTree = equalIsTree;
    }
    
    public String getEqualIsTree() {
        return this.equalIsTree;
    }
    
    public void setLikeIsTree(String likeIsTree) {
        this.likeIsTree = likeIsTree;
    }
    
    public String getLikeIsTree() {
        return this.likeIsTree;
    }
    
    public void setInIsTrees(String inIsTrees) {
        this.inIsTrees = inIsTrees;
    }
    
    public String getInIsTrees() {
        return this.inIsTrees;
    }
    public void setEqualIsWf(String equalIsWf) {
        this.equalIsWf = equalIsWf;
    }
    
    public String getEqualIsWf() {
        return this.equalIsWf;
    }
    
    public void setLikeIsWf(String likeIsWf) {
        this.likeIsWf = likeIsWf;
    }
    
    public String getLikeIsWf() {
        return this.likeIsWf;
    }
    
    public void setInIsWfs(String inIsWfs) {
        this.inIsWfs = inIsWfs;
    }
    
    public String getInIsWfs() {
        return this.inIsWfs;
    }
    public void setEqualComment(String equalComment) {
        this.equalComment = equalComment;
    }
    
    public String getEqualComment() {
        return this.equalComment;
    }
    
    public void setLikeComment(String likeComment) {
        this.likeComment = likeComment;
    }
    
    public String getLikeComment() {
        return this.likeComment;
    }
    
    public void setInComments(String inComments) {
        this.inComments = inComments;
    }
    
    public String getInComments() {
        return this.inComments;
    }

	@Override
	public void setCriterias(Criteria<?> criterias) {
	    if(StringUtils.isNotBlank(equalTableName)){
			criterias.add(Restrictions.eq("tableName", equalTableName));
		}
	    if(StringUtils.isNotBlank(likeTableName)){
			criterias.add(Restrictions.allLike("tableName", likeTableName));
		}
		 if(StringUtils.isNotBlank(inTableNames)){
			criterias.add(Restrictions.in("tableName", StringUtils.split(inTableNames, ",")));
		}
	    if(StringUtils.isNotBlank(equalIsShow)){
			criterias.add(Restrictions.eq("isShow", equalIsShow));
		}
	    if(StringUtils.isNotBlank(likeIsShow)){
			criterias.add(Restrictions.allLike("isShow", likeIsShow));
		}
		 if(StringUtils.isNotBlank(inIsShows)){
			criterias.add(Restrictions.in("isShow", StringUtils.split(inIsShows, ",")));
		}
	    if(StringUtils.isNotBlank(equalIsTree)){
			criterias.add(Restrictions.eq("isTree", equalIsTree));
		}
	    if(StringUtils.isNotBlank(likeIsTree)){
			criterias.add(Restrictions.allLike("isTree", likeIsTree));
		}
		 if(StringUtils.isNotBlank(inIsTrees)){
			criterias.add(Restrictions.in("isTree", StringUtils.split(inIsTrees, ",")));
		}
	    if(StringUtils.isNotBlank(equalIsWf)){
			criterias.add(Restrictions.eq("isWf", equalIsWf));
		}
	    if(StringUtils.isNotBlank(likeIsWf)){
			criterias.add(Restrictions.allLike("isWf", likeIsWf));
		}
		 if(StringUtils.isNotBlank(inIsWfs)){
			criterias.add(Restrictions.in("isWf", StringUtils.split(inIsWfs, ",")));
		}
	    if(StringUtils.isNotBlank(equalComment)){
			criterias.add(Restrictions.eq("comment", equalComment));
		}
	    if(StringUtils.isNotBlank(likeComment)){
			criterias.add(Restrictions.allLike("comment", likeComment));
		}
		 if(StringUtils.isNotBlank(inComments)){
			criterias.add(Restrictions.in("comment", StringUtils.split(inComments, ",")));
		}
	}
}